package com.etl.dataflow.scheduler.admin.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.etl.dataflow.common.response.R;
import com.etl.dataflow.scheduler.admin.entity.DataflowTaskStatistic;
import com.etl.dataflow.scheduler.admin.entity.request.PageRequest;
import com.etl.dataflow.scheduler.admin.mapper.DataflowTaskStatisticMapper;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 任务运行统计信息 服务实现类
 * </p>
 *
 * @author dx
 * @since 2022-04-24
 */
@Service
public class DataflowTaskStatisticService extends ServiceImpl<DataflowTaskStatisticMapper, DataflowTaskStatistic> implements DefaultService<DataflowTaskStatistic> {
    public R page(PageRequest pageRequest) {
        Page<DataflowTaskStatistic> taskInfoPage = super.baseMapper.selectPage(toPage(pageRequest), orLikeAllFields(pageRequest, DataflowTaskStatistic.class, "id"));
        return R.success().put("data", taskInfoPage);
    }
}
